package com.ruoyi.subjectproblems.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.subjectproblems.mapper.TSubjectProblemsMapper;
import com.ruoyi.subjectproblems.domain.TSubjectProblems;
import com.ruoyi.subjectproblems.service.ITSubjectProblemsService;

/**
 * 题解Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-17
 */
@Service
public class TSubjectProblemsServiceImpl implements ITSubjectProblemsService 
{
    @Autowired
    private TSubjectProblemsMapper tSubjectProblemsMapper;

    /**
     * 查询题解
     * 
     * @param id 题解主键
     * @return 题解
     */
    @Override
    public TSubjectProblems selectTSubjectProblemsById(Long id)
    {
        return tSubjectProblemsMapper.selectTSubjectProblemsById(id);
    }

    /**
     * 查询题解列表
     * 
     * @param tSubjectProblems 题解
     * @return 题解
     */
    @Override
    public List<TSubjectProblems> selectTSubjectProblemsList(TSubjectProblems tSubjectProblems)
    {
        return tSubjectProblemsMapper.selectTSubjectProblemsList(tSubjectProblems);
    }

    /**
     * 新增题解
     * 
     * @param tSubjectProblems 题解
     * @return 结果
     */
    @Override
    public int insertTSubjectProblems(TSubjectProblems tSubjectProblems)
    {
        tSubjectProblems.setCreateTime(DateUtils.getNowDate());
        return tSubjectProblemsMapper.insertTSubjectProblems(tSubjectProblems);
    }

    /**
     * 修改题解
     * 
     * @param tSubjectProblems 题解
     * @return 结果
     */
    @Override
    public int updateTSubjectProblems(TSubjectProblems tSubjectProblems)
    {
        return tSubjectProblemsMapper.updateTSubjectProblems(tSubjectProblems);
    }

    /**
     * 批量删除题解
     * 
     * @param ids 需要删除的题解主键
     * @return 结果
     */
    @Override
    public int deleteTSubjectProblemsByIds(Long[] ids)
    {
        return tSubjectProblemsMapper.deleteTSubjectProblemsByIds(ids);
    }

    /**
     * 删除题解信息
     * 
     * @param id 题解主键
     * @return 结果
     */
    @Override
    public int deleteTSubjectProblemsById(Long id)
    {
        return tSubjectProblemsMapper.deleteTSubjectProblemsById(id);
    }
}
